<template>
    <van-nav-bar title="评价详情" left-text="" left-arrow @click-left="goBack" />
    <section class="aui-flexView">
        <!-- 评价详情 -->
        <section class="aui-scrollView">
            <!-- 订单状态 -->
            <div class="aui-pay-change">
                <div class="aui-flex">
                    <div class="aui-flex-box">
                        <h3>{{ info.status_text }}</h3>
                    </div>
                    <div class="aui-pay-zfb">
                        <img src="/assets/images/icon-zfb.png" alt="" />
                    </div>
                </div>
            </div>

            <!-- 收货地址 -->
            <div class="aui-flex">
                <div class="aui-flex-add">
                    <img :src="LoginUser.avatar" alt="" />
                </div>
                <div class="aui-flex-box">
                    <h3>
                        {{ info.address.consignee }} <em> {{ info.address.mobile }}</em>
                    </h3>
                    <p>{{ info.address.region_text + info.address.address }}</p>
                </div>
            </div>

            <!-- 订单商品 -->
            <div class="aui-commodity-bg">
                <div class="item" v-for="item in info.detail" :key="item.id">
                    <div class="aui-flex">
                        <div class="aui-commodity-img">
                            <router-link :to="{ path: '/product/info', query: { proid: item.proid } }">
                                <img :src="item.product.thumbs_text" />
                            </router-link>
                        </div>
                        <div class="aui-flex-box">
                            <h4 class="van-ellipsis">商品名称：{{ item.product.name }}</h4>
                            <p>商品单价：￥{{ item.price }}</p>
                            <span class="aui-barter-time">七天退换</span>
                        </div>
                        <div>
                            <h5>￥{{ item.total }}</h5>
                            <p class="aui-sml-text">X{{ item.pronum }}</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </section>
</template>


<script setup>
const { proxy } = getCurrentInstance()
const LoginUser = reactive(proxy.$cookies.get('LoginUser'));
const goBack = () => {
    proxy.$router.push('/order/index')
}
const orderid = ref(proxy.$route.query.orderid ?? 0)
const info = ref({
    address: {}
})
onBeforeMount(() => {
    getOrderInfoData()
})
const getOrderInfoData = async () => {
    let result = await Api.OrderInfo({
        busid: LoginUser.id,
        orderid: orderid.value
    })
    if (result.code == 1) {
        info.value = result.data
    }
}
const toRatePaes = (id) => {
    proxy.$router.push({
        path: '/order/rate',
        query: {
            orderproid: id
        }
    })
}
</script>
<style>
@import url('/assets/css/info.css');
</style>